home *** CD-ROM | disk | FTP | other *** search
- /*
- HASHelp.h from Hsoi's App Shell. © 1995-1997 John C. Daub. All rights reserved.
-
- This is the corresponding header file to HASHelp.c. Contains declarations,
- marcos, UPP's, function prototypes, etc etc.
-
- Do see the header comments in HASHelp.c for more information and help in using
- this file
- */
-
- #ifndef __DIALOGS__
- #include <Dialogs.h>
- #endif
- #ifndef __CONTROLS__
- #include <Controls.h>
- #endif
-
- #ifndef _WASTE_
- #include "WASTE.h"
- #endif
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
-
- // since not everyone might want to use inline objects (PICTs, snd's, etc) provided
- // by WASTE's 'SOUP' resource, we'll have this flag. If you use objects in your
- // help text, set this to one (1). if you do NOT use objects (no SOUP), be sure to
- // set this to zero (0) else things won't work.
-
- #ifndef WASTE_OBJECTS
- #define USE_SOUP 0
- #endif
-
- #if !WASTE_OBJECTS
- #define USE_SOUP 0
- #else
- #define USE_SOUP 1
- #endif
-
- #define PREFLIGHT_MEMORY 20000L
-
-
-
- // callback procs
-
- typedef pascal Boolean (*HsoiUpdateProcPtr)( WindowRef whatWindow );
- typedef pascal void (*HsoiBeginHelpProcPtr)( WindowRef whatWindow );
-
- // upp proc info
-
- enum {
- uppHsoiHelpUpdateProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
- | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WindowRef /*whatWindow*/)))
- };
-
- enum {
- uppHsoiBeginHelpProcInfo = kPascalStackBased
- | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WindowRef /*whatWindow*/)))
- };
-
- // UPP's
-
- #if GENERATINGCFM // if you're generating PowerMac (PowerPC) native code, this will
- // be true. (it'd also be true if you're generating CFM68K stuff
-
- typedef UniversalProcPtr HsoiHelpUpdateUPP;
- typedef UniversalProcPtr HsoiBeginHelpUPP;
-
- #define NewHsoiHelpUpdateProc(userRoutine) \
- (HsoiHelpUpdateUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppHsoiHelpUpdateProcInfo, GetCurrentArchitecture() )
-
- #define NewHsoiBeginHelpProc(userRoutine) \
- (HsoiBeginHelpUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppHsoiBeginHelpProcInfo, GetCurrentArchitecture() )
-
- #define CallHsoiHelpUpdateProc( userRoutine, whichWindow ) \
- CallUniversalProc( (UniversalProcPtr)(userRoutine), uppHsoiHelpUpdateProcInfo, (whichWindow) )
- #define CallHsoiBeginHelpProc( userRoutine, whichWindow ) \
- CallUniversalProc( (UniversalProcPtr)(userRoutine), uppHsoiBeginHelpProcInfo, (whichWindow) )
-
- #else
-
- typedef HsoiUpdateProcPtr HsoiHelpUpdateUPP;
- typedef HsoiBeginHelpProcPtr HsoiBeginHelpUPP;
-
- #define NewHsoiHelpUpdateProc(userRoutine) ((HsoiHelpUpdateUPP)(userRoutine))
- #define NewHsoiBeginHelpProc(userRoutine) ((HsoiBeginHelpUPP)(userRoutine))
-
- #define CallHsoiHelpUpdateProc( userRoutine, whichWindow ) \
- (*(userRoutine))((whichWindow))
- #define CallHsoiBeginHelpProc( userRoutine, whichWindow ) \
- (*(userRoutine))((whichWindow))
-
- #endif
-
- // this struct (HelpRecord) holds information about our dialog...stuff that
- // we'd like to have easy access to. a Handle to this information is
- // stored in the dialog's refCon field.
-
- typedef struct {
- DialogRef dialog;
- ControlRef scrollbar;
- CursHandle ibeamCursor;
- HsoiHelpUpdateUPP handleUpdate;
- WEReference we;
- } HelpRecord, *HelpPtr, **HelpHandle;
-
- // this is the struct that holds the data/info from our 'Hso?' resource (the
- // resource that holds the resource ID numbers for our dialog; our TEXT, styl,
- // and SOUP resource; and the default strings for saved text and popup menu
-
- typedef struct {
- short dialogID;
- short textID;
- short stylID;
- short soupID;
- unsigned char strings[]; // default file name, menu text
- } ShowHelpInfo;
-
-
-
- pascal void HsoiShowHelp( short infoID, HsoiHelpUpdateUPP handleUpdate,
- HsoiBeginHelpUPP initCallback );
-
- void HsoiDoHelpStuff( void );
- pascal void HsoiHelpModalDialog( ModalFilterUPP, short * );
- short HsoiFindChar( Handle, short, char );
- pascal void HsoiFlashButton( DialogRef, short );
-
-
-
- // some constants for our dialog items
-
- enum {
- cOkButton = 1, /* OK button */
- cHelpRect, /* userItem for our help display */
- cSaveButton, /* Button to save as TeachText */
- cPopupMenu /* userItem for popup menu */
- };
-
-
-
- // and some other constant values for use by the help routines.
-
- #define TEXT_INSET 4
- #define TYPE_HELP 'Hso?'
-
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
-